package com.example.myjpush2;

import android.os.Handler;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;

import cn.jpush.android.api.JPushInterface;

public class MainActivity extends AppCompatActivity {

    private static final String TAG = MainActivity.class.getSimpleName();

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }

    public void onclick(View view) {
        switch (view.getId()) {
            case R.id.btn1:
                String registrationID = JPushInterface.getRegistrationID(MainActivity.this);
                Log.e(TAG, "onCreate======" + registrationID);
                break;

            case R.id.btn2:
                JPushInterface.setAlias(this, 1, "0x123");
                break;

            case R.id.btn3:
                JPushInterface.setAlias(this, 2, "0x123");
                break;

            case R.id.btn4:
                JPushInterface.setAlias(this, 2, "0x12345");
                JPushInterface.setAlias(this, 3, "0x12345");
                break;
        }
    }
}
